<script setup lang="ts">
import { onMounted } from "vue";
import useUserStore from "@/store/modules/user";
import { getTime } from "@/utils/time";
import setting from "@/setting";
const userStore = useUserStore();
onMounted(() => {
  userStore.getUserInfo();
});
</script>

<template>
  <div>
    <el-card class="card">
      <div class="card_box">
        <img :src="userStore.avatar" alt="" />
        <div class="right">
          <h2 class="title">{{ getTime() + "呀" + userStore.username }}</h2>
          <span class="subtitle">{{ setting.title }}</span>
        </div>
      </div>
    </el-card>
    <div class="bottom">
      <svgIcon name="welcome" width="600px" height="300px"></svgIcon>
    </div>
  </div>
</template>

<style scoped lang="scss">
.card_box {
  display: flex;

  img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
  }

  .right {
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;

    .title {
      font-weight: bolder;
    }

    .subtitle {
      color: #ccc;
    }
  }
}
.bottom {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}
</style>
